//
//  ZDVistorTableViewController.swift
//  ZZDWeibo
//
//  Created by zzdan on 16/6/25.
//  Copyright © 2016年 zzdan. All rights reserved.
//

import UIKit

class ZDVistorTableViewController: UITableViewController {

    //用户是否登录
    let isLogin: Bool = false
    
    
    //访客视图的对象
    var visterView:ZDVisterView?
    
    override func loadView() {
        if isLogin {
            
            super.loadView()
        }else{
        
        //未登录的时候
        setupNav()
        setupVisterView()
        }
    }
    
    // MARK: -   设置访客视图
    private func setupVisterView(){
        
        visterView = ZDVisterView()
        
        visterView?.closure = {[weak self] in
//            self.login
            
        }
        
        view = visterView
        
    }
    
    
    // MARK: -  设置导航栏
    private func setupNav(){
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "登录", style: UIBarButtonItemStyle.Plain, target:self , action: "loginClick")
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target:self , action: "loginClick")
        
    }
    
    
  // MARK: -  按钮的点击方法
    @objc private func loginClick(){
        
        //弹出登录控制器
        
        
    }
    
    
    
    override func viewDidLoad() {
        
        super.viewDidLoad()
    }
    
    
}
